<!--
SPDX-FileCopyrightText: 2017-present Tobias Kunze
SPDX-License-Identifier: AGPL-3.0-only WITH LicenseRef-Pretalx-AGPL-3.0-Terms
-->

{% extends "cfp/event/base.html" %}

{% load i18n %}
{% load rich_text %}

{% block title %}{% translate "Accept invitation?" %}{% endblock title %}

{% block content %}
    <h2>{% translate "Accept invitation?" %}</h2>
    {% if not can_accept_invite %}

        <p>
            {% blocktranslate trimmed %}
                Unfortunately, you cannot accept this invitation at the moment.
                This may be because the invitation has expired, or because the
                proposal cannot be edited any more.
            {% endblocktranslate %}
        </p>
        <p>
            {% blocktranslate trimmed %}
                Please contact the conference organisers for more information.
            {% endblocktranslate %}
        </p>
    {% else %}
        <p>
            {% blocktranslate with name=request.user.get_display_name talk=submission.title trimmed %}
                You, {{ name }}, have been invited to be a speaker for the session
                “{{ talk }}”. Do you accept the invitation?
            {% endblocktranslate %}
        </p>

        {% if submission.abstract %}
            <div class="card ml-auto mr-auto col-md-9">
                <div class="card-header">{% translate "Abstract:" %} {{ submission.title }}</div>
                <div class="card-body mt-0 mb-0 mr-3 ml-3">
                    <p class="card-text">{{ submission.abstract|rich_text }}</p>
                </div>
            </div>
        {% endif %}
        <form method="post" class="form">
            {% csrf_token %}
            <div class="url-links">
                <a href="/" class="btn btn-danger btn-lg btn-block">{% translate "No" %}</a>
                <button type="submit" class="btn btn-success btn-lg btn-block">{% translate "Accept invitation" %}</button>
            </div>
        </form>
    {% endif %}
{% endblock content %}
